package com.jackrain.nea.ext.permission;

import lombok.Getter;

/**
 * @author lzm
 * @date 2017-11-16
 */
@Getter
public enum MenuType {
    UNKNOWN(0, "未知"),TABLE(1, "表"), ACTION(2, "动作定义");

    private int value;
    private String desc;
    MenuType(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static MenuType valueOf(Integer value) {
        if(value == null) {
            return null;
        }
        switch (value) {
            case 0:
                return MenuType.UNKNOWN;
            case 1:
                return MenuType.TABLE;
            case 2:
                return MenuType.ACTION;
            default:
                return null;
        }
    }
}
